Skip to content

Use rbs-inline of rbs 4.0.0#408

Draft
mame wants to merge 4 commits intoruby:masterfrom
mame:migrate-rbs-inline-parser
Draft

Use rbs-inline of rbs 4.0.0#408
mame wants to merge 4 commits intoruby:masterfrom
mame:migrate-rbs-inline-parser

Conversation

@mame
Copy link
Member

@mame mame commented Mar 2, 2026

WIP

mame added 4 commits March 2, 2026 09:36
Run RBS::InlineParser.parse() once per file during parse_rb and build a
lookup table keyed by Prism node object_id. DefNode now resolves inline
RBS annotations via this lookup first, falling back to the manual
get_rbs_comment_before for top-level methods.
Extend InlineParser lookup to also collect AttrReaderMember,
AttrWriterMember, and AttrAccessorMember. When an inline type annotation
(e.g. `attr_reader :foo #: Integer`) is present, add a method_decl_box
to constrain the inferred type.
Drop the manual RBS comment extraction fallback now that InlineParser
handles all in-class method annotations. Update 9 scenario files to
wrap previously top-level methods inside classes, and remove the unused
comments field from FileContext.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant